from django.shortcuts import get_object_or_404, render_to_response
from projects.models import Project

def index(request):
    object_list = Project.objects.order_by('-pub_date')[:10]
    return render_to_response('projects/project_list.html',
                              {'object_list': object_list})

def detail(request, object_id):
    projects = get_object_or_404(Project, pk=object_id)
    return render_to_response('projects/project_detail.html',
                              {'object': projects})